﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Utilities
{
    public static class _MathHelper
    {
        public const float Pi = 3.1415926535897932384626433832795f;
        public const float TwoPi = 6.283185307179586476925286766559f;
        public const float InvTwoPi = 0.15915494309189533576888376337251f;
        public const float SqrtTwoPi = 2.506628274631000502415765284811f;
        public const float InvSqrtTwoPi = 0.39894228040143267793994605993439f;

        public static float Exp(float x)
        {
            return (float)Math.Exp(x);
        }
        public static float Sqrt(float x)
        {
            return (float)Math.Sqrt(x);
        }
        public static float Gaussian1D(float x, float d)
        {
            return 1 / (SqrtTwoPi * d) * Exp(-(x * x) / (2 * d * d));
        }
        public static float Gaussian2D(float x, float y, float d)
        {
            return (1 / (TwoPi * d * d)) * Exp(-(x * x + y * y) / (2 * d * d));
        }
    }
}
